<form action="<? echo base_url()?>history/delete" method="POST" id="delete_form">
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
	<th>체크</th>
	<th>내용</th>
</tr>
</thead>
<tbody>
<? if(!$history): ?>
<tr>
	<td colspan="2">내용이 없습니다.</td>
</tr>
<? endif; ?>
<? foreach ($history as $row) :?>
<tr>
	<td><input type="checkbox" name="check[]" value="<?=$row->id?>" class="checkbox" id=""/></td>
	<td><?=$row->data?></td>
</tr>
<? endforeach; ?>
</tbody>
</table>
<p><input type="submit" value="삭제" class="btn btn-danger"></p>
</form>
	
<form action="history/delete_all" method="POST" id="delete_all_form">
<input type="hidden" name="okay" value="okay"/>
<input type="submit" value="전체 삭제" class="btn btn-danger"></p>
</form>
	
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
	$("#delete_form").submit(function(){
		if($(".checkbox:checked").length<1) {
			alert('하나 이상 선택');
			return false;
		}
	});
	$("#delete_all_form").submit(function(){
		if(!confirm('정말 전체 삭제하시겠습니까?')) return false;
	});
});
</script>